{"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "vzrhAgvnLYSZGK7FD", "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\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": "p8sgQiJ7vSkN5Lx5B", "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:13:29"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "Hj8LKuGASDLeveCg4", "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) implies s.(t<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9dvXtudvJxiQTSBEH", "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 20:57:38"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "Ta98EY54FoLstcmNS", "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,g:Group | some 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": "suXdyuZkhog5AR6bu", "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:39:50"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "CZTfEHWLrkQevQ5t2", "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/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student 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": "LwGQTJ6TYCEEJbkPw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:31:58"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "Ebf68TrQiAffmm3B9", "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.^Teaches\n}", "derivationOf": "E5kEhbb2GvoRvxWJS", "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:44:41"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "yyo6A4eMBoYJZWjon", "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 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": "SPdR8rC6eiTmMvRoa", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:07:32"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "9dvXtudvJxiQTSBEH", "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) implies s.(t.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MMajM3pWQjodnsusq", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is t . (this/Person <: Tutors) (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:57:29"} {"_id": "Mn68TGy7BKjygE366", "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\tClass . 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": "6z75tktbFM2iFzy7F", "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:28:49"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "8ouCt4iEBPdKWwAjL", "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": "zAZFMi3PoHTn7jcsL", "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:28"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "pSaWo8S3pqWNetdg3", "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 | Teacher 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": "untrM2DCg3SFAYuXz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:49:31"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "KRgsYWbmNAtxCMzjS", "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\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": "59o7rZFTkSZXLKt6n", "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:19:34"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "yBLhQA5eg3mcfAYmD", "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\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": "NDWYWGTnqcaf4kiHh", "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:29"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "BE39ui4tdmPh6bJWd", "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 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\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": "9htjdh8H4vJmfbyD6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:50:52"} {"_id": "8uK8ERaL57MSZ7QYt", "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<:Tutors).c implies some s.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FtqqyqBZ8jwEk8zE2", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:02:47"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "NGF3fDsyp8QyKKQ35", "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\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3rC4HPnjSwdrSu7Y9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-12-8 11:57:19"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "b43rJmKKt7nyjPGqv", "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 ~Teaches.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": "jyBfEhfNrtw4EntZv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:09:51"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "kWjHf3SYibSieS8qe", "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": "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:43:44"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "ETs6cvB97EosWqpYS", "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\t~ (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": "oLuiY34C4ersCHxNz", "msg": "This expression failed to be typechecked line 55, column 2, filename=/tmp/alloy_heredoc4230799115542067008.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:30:30"} {"_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": "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": "EK3MnmQ6PgssvauE2", "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\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned 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 03:34:35"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "RmxeTrs7wGpxzHz28", "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\tall p:Person | p in Teacher or p 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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CJu9PAjEyBiXeEu44", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:02:52"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "RMb9QsfLqcjWwWrBm", "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\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": "WntRjhAGXsp29WeST", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:36:29"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "prBvphkZqWvgwXyjg", "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:06:26"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "PL2hxEbc39MsjrsKD", "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": "EMDJsam65LeKh2f4e", "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:30"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "KsMoRFQPgZBGNcNyv", "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\tTeacher 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": "aYn8sNDeQAGyEm8uT", "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:34:02"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "xTjcXtjigPvyoRmM8", "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 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": "RDPTLmtxq9PSAQQuW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:46:58"} {"_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": "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": "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": "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": "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": "EfrsfJbkL4T9TbkKc", "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 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 \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z5ax4XGRN2Bh2yoM8", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:09:54"} {"_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": "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": "d3AZCBrejGbaq3bRF", "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}\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": "tHqgTPPPbKdebLH8W", "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 17:30:55"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "vm6eBFEMpR2TrT6vD", "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": "sxhH2b7avRk6NFjhZ", "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:31"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "SgXZiXxeXBSwpCHzq", "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 Teaches\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KHSCA38w9R3C3G3yY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:43:36"} {"_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": "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": "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": "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": "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": "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": "A8swM6iXGkbjBxgij", "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 p:Person {some c:Class | c in p.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": "rdk2MG8PLNSPpC3cx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:44:39"} {"_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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "u7488yfn5fwGy9fs5", "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.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": "8CTJybAxY6rTciEoQ", "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": "2019-10-3 10:40:18"} {"_id": "n4gsiK8D7jdvH6fcG", "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 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": "LnpD9uSGm3nkTQDQi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:36:19"} {"_id": "fzuJWDzFBTPRJcJSz", "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 & 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": "z6vvCvpihZrPTudd4", "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:26:13"} {"_id": "Kr8XcBueWFSCMeRF6", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither 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": "H9HFhYuB8zwaNoLTr", "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:42:09"} {"_id": "YsBfaAgZt5cNcSoiR", "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 (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": "R6batN6oGxP3cs74y", "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-13 20:11:41"} {"_id": "cDMHt2BvNNddodJbc", "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": "EfrsfJbkL4T9TbkKc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:13"} {"_id": "ebrE4rRTqzaxTSCq9", "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\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": "8jrHsm7tm6EcMRwmT", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:48:47"} {"_id": "YjdyeAK3KpMiM8iFd", "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 \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 t: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\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": "WKScfnRmoedAEQqAn", "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 18:42:44"} {"_id": "fZypoyP9r6nb2ZwbC", "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.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": "Ld7ngJNmA9pFTmihX", "msg": "The name \"p\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:19:09"} {"_id": "7pXQk7urp9r3hCi8W", "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": "Km4DxiD3jFaH5iNSC", "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:07"} {"_id": "oHTxaPh7PtGzNbHRc", "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": "zzspMNmM2ntgoeWTD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 22:52:35"} {"_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": "tLnuhC6RSixt5PAQP", "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 some Student.(Teacher:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8C4Dade4vPjNjD6KR", "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:37"} {"_id": "oamkMdjoFeBWQvkDW", "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": "cjthZsDhFf6EbZAM8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:32:21"} {"_id": "kT54H4JKhKBBmb2uu", "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 Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teachr + 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": "p6qGQyEfSM9WoJdtX", "msg": "The name \"Teachr\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-8 16:21:00"} {"_id": "jyBfEhfNrtw4EntZv", "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 ~(Teaches :> Class).(Teaches :> Class) 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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:08:36"} {"_id": "MQwyrap75gb3z536g", "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 | 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": "7WgNGYmjnn2EGinMS", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Tutors) . s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:24:09"} {"_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": "ge99oDJMwrnYNSLpG", "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.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LJkWuzQv63x2W7sjD", "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-14 11:55:08"} {"_id": "5BKnrtFgsBh5rN4ex", "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": "fMsHHWdmzZvdMPGku", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:48:06"} {"_id": "478FZB4Pps5bd3jEh", "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-1-2 15:01:47"} {"_id": "aMEn9S2SvpmcDY5ED", "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": "5e6EWNdebHzMxpLPj", "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:39"} {"_id": "qN28PWkg5cACivJKX", "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-11 11:25:40"} {"_id": "HNPFnrNc6g5wf793h", "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": "AfMMA2FysiHSGdWkf", "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:35"} {"_id": "wYCe5pdcFhCF6GbEt", "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\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": "MQ4BhhNL7Ho4cEgeW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:06"} {"_id": "Hi3gFeDA3ajnQttXW", "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": "2019-10-3 10:07:05"} {"_id": "4rYC9DZvoK9TM34ox", "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": "rDagBwkb9iR94KSX5", "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:31:02"} {"_id": "YzAojKg2T3CZ4YHKm", "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\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EENKfhoz57cJxqgtu", "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:48:09"} {"_id": "3vaQF7qdinGYCpBJJ", "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}\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": "Mn68TGy7BKjygE366", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:29:11"} {"_id": "4KkPtcipzhx9wAHdx", "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": "7yoAQqhLsccwH5TMi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:14:10"} {"_id": "QRKCo99CezLRyYayW", "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) & some t.(Teaches.c) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "83DDntQF2BYLAvBAq", "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-15 20:55:54"} {"_id": "RErw6SZwqQgivNyzF", "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": "3NEu3HKy7GqCtGREa", "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:43"} {"_id": "8jTTKoMcQ26Dwgag8", "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": "ZuFuqLFTYGREjdCfK", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:02:12"} {"_id": "dMY6ShZLc2oh6zfKj", "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": "PPcQMMiaHmoSB3JiY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:35:18"} {"_id": "94wQMpEjDTxJA5mAp", "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": "ymsBKctfpEh7WTKCx", "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-15 21:18:59"} {"_id": "3tP8ys4qQtgGfnoNC", "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\t 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": "bWMhPqFdar4RqfX5R", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:50:01"} {"_id": "SyXftfhikgTPFBFFi", "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": "e9EXfNPzNdKF5vQH3", "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:19:54"} {"_id": "RWdN7m66cHXFucDSf", "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\tno Teacher & Student\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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CZTfEHWLrkQevQ5t2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:33:42"} {"_id": "ywSKjp3dNvEzrtkmv", "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 Person\n\tno Student and 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": "qfzZovTYQK3Jz9Kwo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:51:58"} {"_id": "K48ZRDyfArs2WbXPD", "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": "Zk6saY3paGRAFnawW", "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:01"} {"_id": "osj3RRHs3chPsmrZd", "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": "HWBw9JmKK8Xj7TXCy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:18:12"} {"_id": "PSfqW6Ccr6PWwnPZ4", "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": "FW7fKv9xbFsGpmk8H", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:56"} {"_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": "E7yfYKAZD42XZoXLE", "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\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": "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": "2019-10-22 22:26:15"} {"_id": "9K3r4vqqjWHsDGb9L", "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 (Teachers 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": "AWbuqrrRHaSrmPYL7", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:38:21"} {"_id": "8NGvw7htwvhsCMoD7", "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 and 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": "WdHpYeCLudKvfJdj8", "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:27:49"} {"_id": "d54yd95PMT2qR5Lax", "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": "NJpLp9ubNovDZ4gxL", "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:56:21"} {"_id": "2QPoQpn7Dzjw4BFwM", "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": "caBTRXpAMjWAfH5qq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:39:32"} {"_id": "9uZ4ggZthSm9WdJPN", "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 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": "CZwGffYjFdZwwpLu5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:16"} {"_id": "A5wT9vPoYGJQwQkLu", "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 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": "EkxiKFTL52YSE644h", "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:13:13"} {"_id": "mYxKkFLuh2jgcMffd", "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": "w6XsFSwSCnejyK5N8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:41:47"} {"_id": "6EMfWYPfsw5AwFdj4", "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 \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": "iq9WRRQu95u6Ka9SH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:57"} {"_id": "xtb3dNEwBciHfoB8x", "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\tClass.Teaches = 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": "tEij8awKjcHfNGZS5", "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:20:54"} {"_id": "xvNzyovtdeWuxcTXR", "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 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": "FBWeDi4bGzLJd2QTX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:32:49"} {"_id": "bp9M9TxaAkxDW3fCH", "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": "DqFMvEmg6q6SDNDan", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:56:37"} {"_id": "tHqgTPPPbKdebLH8W", "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\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": "Ta4h2LBSGDpm8Sxdr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:30:12"} {"_id": "EBzzhwpeD8nZsjbBJ", "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\tPerson - Teacher = all\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KckgYQxJpo6WhiKna", "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:09:13"} {"_id": "untrM2DCg3SFAYuXz", "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 | 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": "kTCKqgNnqdoAqfrbi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:48:38"} {"_id": "WNuZhhq7t9wAKFReJ", "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\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": "xvNzyovtdeWuxcTXR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:33:59"} {"_id": "xqLyyRw3S3T2sjTdd", "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 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": "vm6eBFEMpR2TrT6vD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:40"} {"_id": "3rC4HPnjSwdrSu7Y9", "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\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned 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-12-8 11:57:10"} {"_id": "rYYTCigPGWWkWdaPi", "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 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": "BuHyYqm4cQCtbd3y6", "msg": "The name \"inv5O\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:58:08"} {"_id": "fQ54bsfmK72SiQPAm", "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| s <: c.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": "FsNaqvFJRtKufLeux", "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:26:43"} {"_id": "ZmLHK56whyyAZtoQg", "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": "j7xT9Q65jzrbcfyhz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:45:24"} {"_id": "gzz4HyQ2n2xv8twg8", "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": "X2C7sczBAFMaEBccy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:23:29"} {"_id": "Cd8CrDKgRbBvgNRhC", "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 | Tutors:>Student 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": "cgxhG98xKJcGDadXa", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:40:19"} {"_id": "PRWTYLmxN67A6LvLA", "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 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 Teaches . Class . Teacher = 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": "TjDc2ybC6z3492tNi", "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 09:38:01"} {"_id": "T8m4SPoKaZbufXBu2", "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 p:Person | Teacher in p.^Tutors\n}", "derivationOf": "HLpvLt3hwFoTyiSxh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:47:06"} {"_id": "X6Ybs5jTqTCRDd459", "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\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\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": "pg5SihazPu6PeKY2j", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 09:47:02"} {"_id": "c3dB6nLZgev3EHG2v", "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": "q2PsHRJgFsLFMDTwL", "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:06:01"} {"_id": "arMyWXqeewLJ3CQTS", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TLt28fMhdibvMsCtF", "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 17:28:06"} {"_id": "2EsTdDA2PhYHc95ms", "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 t : Teacher | t.(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": "c7LX5SsmTtnfQdqWP", "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:41"} {"_id": "kv7v2uvJWyXmPuAQP", "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": "Z2tue7Cg4Ls4zpssH", "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:38:36"} {"_id": "KPZLNGYfDKQyd85XQ", "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\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 Teacher.Teachs\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dox4emkYZYP5E5hc4", "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 03:52:47"} {"_id": "zYsEF2fcFT8HuuQ83", "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 Student & Teacher\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\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": "fDkvAPyj7RsxMhcTo", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:48:48"} {"_id": "vHpEjyf2sv6zTPrfF", "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": "2G4vyrxaGE2eFX54P", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:05:03"} {"_id": "iL6KW2gG27mfiPDnd", "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\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": "cXES5J45dnsgYFuN6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:33:38"} {"_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": "DTe4sDqu5Nkjfif6G", "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\tTutors.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": "n2tv8qG2mCzTer4e9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-4 07:32:59"} {"_id": "gYXyjnh7KGaDkMBJi", "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 Teacher -> c & 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": "xbz5irKEwAmY7C79r", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:52:10"} {"_id": "59o7rZFTkSZXLKt6n", "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": "8uRZ6HzWzt9XmT4Fq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:21"} {"_id": "iiSnFj3q7qRsdsaBo", "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\tPerson in Teacher + Student\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": "eT67kxM4Li5S4ieKt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-12-8 11:59:06"} {"_id": "YT4c6ivkD4FwJogiq", "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 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 Teachers <: Tutors = Tutors && Tutors :> Students = 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": "Cw9Qoo3jfawvRgd4e", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:24:59"} {"_id": "Czuz6yLgwevPjYcfX", "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-30 01:13:47"} {"_id": "kXYfstaL9f2iG5fy6", "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": "jR8snY5KgsTkHpj3K", "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) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:54:02"} {"_id": "WTLSA3XLbgARyrfCd", "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\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 \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mCkzSdTHyPkMwXijJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:37:12"} {"_id": "zE6FJGboP8puDtCKM", "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\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D6EfqCC4sus2mvRXt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:40:24"} {"_id": "CsNFAsz26XZB6K6W8", "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": "AAREZ7akeRouk2XsX", "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:18"} {"_id": "zEuehoXPXS4GfGde7", "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\tStudent + Teacher in 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": "C3EXvS938hJZtsL6e", "msg": "Subset operator is redundant, because the right subexpression is always empty.\nLeft type = {this/Person}\nRight type = {none}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:09"} {"_id": "FsNaqvFJRtKufLeux", "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 | c:Class| s <: c.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": "Ht7Y4AMfERaxtLjCz", "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 19:26:37"} {"_id": "557HDjKFR6PZnqpkW", "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/* 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": "pyzTYz75Dn83fznDH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:06"} {"_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": "uKhoe3HaeGgxneo3t", "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": "nvGXGye5m3tDQwC87", "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:04"} {"_id": "LoFffiDm7gMNKMBYZ", "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 t : Teacher, c : Class | some Student.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ByWqj38nbhx5CgEjT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:10:26"} {"_id": "wchEKMzh2kPFerCzx", "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\t~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": "CGHLuDkkAErxTzyZK", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:43:08"} {"_id": "GegRPMabnZFCFJuDn", "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 = 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~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": "4Xzyzmrzmopmqzsfb", "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:28:18"} {"_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": "p3QS5KfPNvdLznR5g", "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\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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": "RkxpLPTjps5a6byee", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:37:00"} {"_id": "M6MK6SsPPuRzkFqHo", "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": "YNKqY43GZj9Cfvz94", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:13"} {"_id": "RnDnYogc9vW24cd7d", "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 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": "DnAiSD6Rm3AmbbNDQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:27:45"} {"_id": "Xk87cQNnwyKnmDxKS", "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": "ubH3AfwHZn2JxgYjm", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:02:14"} {"_id": "dmbR39YkX7baJpPTt", "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\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "beGpaPtnhaZ6k4MwP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:17:32"} {"_id": "9ayJq7NT5LqNJXN8f", "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}\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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7HaMnzxJjhpCFQCsS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:42:24"} {"_id": "WJmC7qDsGyxh8DWmk", "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 = Class . Groups . Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "73fpTBudsKXsh7qSt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:29:06"} {"_id": "ixYARnmqoLYaQyncz", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither 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": "jbe2cNnrJ6WnripWb", "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:05:54"} {"_id": "KarvkqrWcPy7jEbEa", "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": "QR37HFyE5ek8MtcAx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 01:49:59"} {"_id": "DSWrjNBG4fkbEkBCw", "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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6WihtTigQjk3wB7Zy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:16:11"} {"_id": "iaTNPgNu9ipFrn7dZ", "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}\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\tall g:Group | some c:Class,some t:Teacher | t->g in 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": "ES27GTTGeW5d2nrch", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:49:18"} {"_id": "WKvLffvqZAqDFuyL6", "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 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": "xMn4dFtWqpE7uLpAu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 20:49:05"} {"_id": "FtqqyqBZ8jwEk8zE2", "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<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iws5pnnBWzfkdAuFE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:01:53"} {"_id": "q3SnHZ2QePrstG3xX", "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\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 | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s : Student | some s.(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": "QSsS75yEEWMrZcD9K", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:28:06"} {"_id": "YEpLgfx3QgtqET5SD", "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 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": "zEuehoXPXS4GfGde7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:11:01"} {"_id": "atLLNMHchTE8zNrpA", "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\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": "6FGNZY8Bg3XWk9xo6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:19:10"} {"_id": "pwCzhjC99YHHhArf8", "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 + Student\n}\n\n/* 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": "iqbAgGGHgARZtMoSM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:39:40"} {"_id": "oMMQnSkxtN9SXqRgD", "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 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": "X6Ybs5jTqTCRDd459", "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:47:56"} {"_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": "iFeB3nFn4miEjD2CC", "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 | some t.Teaches implies 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": "w6RoS7phXEE4ctiuE", "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:51:26"} {"_id": "95JH7dr3963DpwsAp", "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 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": "E7C7oBCGyMgoqukNg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-13 18:41:52"} {"_id": "naH6hpcuCf3uN4Sok", "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": "xzfApwhbcWGGsDNn9", "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:40"} {"_id": "BeNtb8dA4uujiH8H5", "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\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": "qu567z46vdHBMb2B4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:05:48"} {"_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": "EhYukWLz4XyufMmEB", "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": "XNYhKWQ9F8e5s3qXF", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:41:23"} {"_id": "YEx9htQLEK45ZQiqY", "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": "A5wT9vPoYGJQwQkLu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:13:34"} {"_id": "JdnfyzTfPEkJscCaR", "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-11 11:27:30"} {"_id": "eT67kxM4Li5S4ieKt", "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 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\tPerson in Teacher + Student\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": "L7M4RWWhP7XDNCfBn", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-12-8 11:58:48"} {"_id": "cuxPaYj3cEZSpo5kA", "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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WSxqcdNZFjWRjD8w8", "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": "2019-10-3 10:10:04"} {"_id": "E3tysNAwu2ExivZCa", "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 | 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": "7CcenzEpmuqF455xu", "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:43"} {"_id": "BPkAdSXpXLMpN5QZa", "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 Teacher.Teaches in 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": "YZJ3gnvc9x2nhhWzd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:25:47"} {"_id": "Jct2bAFSEcJrixRi2", "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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CfdDRr3kaZqBzXfET", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:35:46"} {"_id": "tpR9pzbuXcBFTaQCK", "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 : Student | some t : Teacher | t in s.^Tutors\n}", "derivationOf": "Q9tx7ciRYKzLKht55", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:27"} {"_id": "zzspMNmM2ntgoeWTD", "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 \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": "oARhtJCFdwnfXJPN5", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 22:52:25"} {"_id": "ugisii36PufLxFSDD", "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 Teacher & no 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": "gm9NxPKpNuhBgqexJ", "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:45"} {"_id": "j8vhD9b9F3xyoXMft", "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<: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": "Pgc6HaStmED7utgQG", "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:46:28"} {"_id": "Gef9WJtob4ommkFFc", "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,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": "2PRK3xaide8jb244B", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:41:39"} {"_id": "KSXXgHxdyxn45FjJo", "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\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": "hDDuqAKL2yzAxK5Si", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 17:37:27"} {"_id": "mDZfmfTE7XvCxor4Z", "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 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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hTJRdZJmGaDN5Tg89", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:31:28"} {"_id": "oBYzBzYWfbSRzqhv9", "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": "A3s8oFNHWTQ2t6YxA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:20:04"} {"_id": "z3YmczTkHwXcpvqDq", "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(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\t^Tutors.Person & some Teacher\n}", "derivationOf": "tLa4q9AvtNtTLZRuC", "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 12:22:47"} {"_id": "aQzwoTWQkNAkgSegC", "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": "qN28PWkg5cACivJKX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:27:03"} {"_id": "2YnbFYRRhopa9Mb4s", "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": "dWp84mJtEzpzzdfbQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:06:56"} {"_id": "vQ8Zw65kuRtpsv6XF", "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 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": "KsMoRFQPgZBGNcNyv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:40"} {"_id": "sHEph8LfC8jC7mep4", "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}\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\tall g:Group | some c:Class,some t:Teacher | some Classes \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iaTNPgNu9ipFrn7dZ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:49:47"} {"_id": "iB8bN6KeDbBSAeD4m", "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 c.(t.Teaches) implies s.(t.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5uWNtoB6aSjBpSdFs", "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 20:57:04"} {"_id": "xCaxoD9Ayx6jWJEvG", "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": "uQ2BpqrJGtbA4uH9K", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:29:12"} {"_id": "RoreoevkE3qf3y527", "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 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 all (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": "YQ8P7rhXLH6KnWDvt", "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-14 10:39:00"} {"_id": "vwr79BWRdZ3tHWdqi", "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": "bZrkrrMDxCdujcBxS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:22:23"} {"_id": "6WihtTigQjk3wB7Zy", "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 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JMwCGnuZE3B4XrXZd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:11:47"} {"_id": "A4GFagMpsv4NL7MuL", "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": "Sery2apcYDb4WFtJd", "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:05"} {"_id": "vHKHZdMqqZaNZXYkq", "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 | lone 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": "7xF9ZLxg5bC46J92Z", "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:35:04"} {"_id": "5NTe2XC6AHmKzy3vT", "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 Teacher.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": "fZypoyP9r6nb2ZwbC", "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:19:16"} {"_id": "ZTJgmkXzz9KmavrTG", "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 & 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": "FJBAuckH3vuXsgDrK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:04"} {"_id": "xjZLsS4ojJerjaZgN", "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\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": "v9MzCvfBkM3r3jW3e", "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:03"} {"_id": "XhLEJntChbzCoL8TB", "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 in group|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": "WA7DxowFuos9nhaPi", "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:50:07"} {"_id": "YhZ6Qjy9J5g7AGEj2", "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": "vzYzcc5ccafdvMHwx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 01:44:10"} {"_id": "iXNJsXcBDXz7mntiz", "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": "prBvphkZqWvgwXyjg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:42"} {"_id": "kxst3EfKfds5cE3po", "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": "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:44:13"} {"_id": "cowPgYzZiYA6sjZ9z", "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": "94wQMpEjDTxJA5mAp", "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:07"} {"_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": "rDcv995uuDc3RdZGt", "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 | s.^Tutors \n}", "derivationOf": "ZRg4Yh3oB9cmhrSCY", "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:55:33"} {"_id": "q2SGqEK7G3DfGRb3J", "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: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": "2QPoQpn7Dzjw4BFwM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:39:43"} {"_id": "v9MzCvfBkM3r3jW3e", "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 = 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\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\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": "2gu8QJnCBChsRXjgL", "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:41"} {"_id": "CmWdnwCr4e8yhZYwk", "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 s : Student, c : Class | some 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": "CZmD788MoDfKHjGLg", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:39:53"} {"_id": "Bp9s4djMyheXsotv2", "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\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": "fH5nWkSMmG5f9dJgM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:44:11"} {"_id": "JRfeqWf68ZQzsG3tZ", "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 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": "Pz8XENZxEcuxfFAyP", "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:09:41"} {"_id": "NDWYWGTnqcaf4kiHh", "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": "B2rbrP86EFNyihaku", "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:34"} {"_id": "A3s8oFNHWTQ2t6YxA", "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 = Student + Teacher\n}\n\n/* 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": "Xz8uM6qnay4Hu6F4G", "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-10 15:19:47"} {"_id": "fDJoSGm2b3vR3NEQT", "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": "eXujxvkD2EmzydZp5", "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:57:19"} {"_id": "ubH3AfwHZn2JxgYjm", "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": "T4FWbEKomcpnqDPBz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:01:11"} {"_id": "RSmLHFPACJmJbchvL", "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 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:45:01"} {"_id": "z6vvCvpihZrPTudd4", "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 Teacher.Teaches 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": "BPkAdSXpXLMpN5QZa", "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:26:01"} {"_id": "YEAAtk8ezbXwtSkAu", "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 x, v : Person, y : Class | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\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": "BoDshEgoGq6hAo3qf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:53:37"} {"_id": "HtnubqExwpquHxi4M", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HBYrH5JSnmPcp5wbf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:49"} {"_id": "8HbvF7fz234gZDSJy", "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\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": "8nXcfDJ4uQyJYqir7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:46:26"} {"_id": "DmjGNXnRnQqDTguXo", "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": "5EP3GDyrBaBHpPWJp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:34:44"} {"_id": "e8BpfEfDpQTNWnpbv", "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\tTeacher <: 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": "gdWuELxQKarbprpix", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:23:03"} {"_id": "LG6i2uoktYWtgJegk", "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 & 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": "orY9neqTQ8nRuLxPP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:23:51"} {"_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": "8aHjKSjSZjbkXsrd4", "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 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": "qkXFsNsJDYxfa8DuX", "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-15 21:24:49"} {"_id": "m6CeracaJtjjPLH7f", "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 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": "XG7tZDiKfHJckmFut", "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:18:35"} {"_id": "RDnyXdwRi6y625JZt", "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\tall c:Class | c in 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": "KSXXgHxdyxn45FjJo", "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-11-13 17:37:57"} {"_id": "AokDqH4Rwdmnrs9rq", "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\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": "hMMqGD5gRhMxp4YvM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:24:42"} {"_id": "RkxpLPTjps5a6byee", "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\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": "nz7knSSwfeMnFSmN7", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:36:55"} {"_id": "ZfBNJDnBLcMyDktLA", "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\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": "swEFZKYNdRKammTgk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:45:30"} {"_id": "WDeSE4TCyzJwbYR8M", "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": "vq4t5BJt8jzgiBwtN", "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:54:03"} {"_id": "bvjPD9XuKFXBvsxHd", "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.Class) implies some t<:(Tutors.s)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MQwyrap75gb3z536g", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:24:34"} {"_id": "smoHdfbebkbZQbZcN", "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}\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\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": "5tuqbJXjgqvFoXq3x", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:45:20"} {"_id": "TMqmSH5mBrJjm37Bw", "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 \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\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": "YjdyeAK3KpMiM8iFd", "msg": "This expression failed to be typechecked line 91, column 34, filename=/tmp/alloy_heredoc15677121254809855894.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:42:52"} {"_id": "rcePzetNt6TQZryfK", "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 & 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": "RR55kkTdEZHKA3N5j", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:48"} {"_id": "oXycrNwMokD5Jmcsz", "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 | 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": "ycoSQLmvc9zXczEbo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:54:33"} {"_id": "hCjQbZFtnpm7f4tAL", "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 (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 t:Teacher | t in (p.^Tutors)\n}", "derivationOf": "aawA4qGvMmGr75y8W", "msg": "This expression failed to be typechecked line 90, column 34, filename=/tmp/alloy_heredoc7819818484910453696.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:54:31"} {"_id": "7PBZqzn7gyP2qaZ3g", "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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8HbvF7fz234gZDSJy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:47:23"} {"_id": "n925Cah3K5Sw5iJwH", "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\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7tqceFphwwuDDj6k2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:34"} {"_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": "ytev9JeAHmDvHFKF3", "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 | one 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": "72uZM9cyiqX2SF6XQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:37:48"} {"_id": "8efyhb5Jxs8dLgzSq", "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 in Teacher.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": "CKEvbobowdeSt8zeM", "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:27:08"} {"_id": "btWBYjZCfqkvD23n8", "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\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\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": "zwuXk8BWnCeHHCi5R", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:21:44"} {"_id": "nFYg549xWRkttAXW8", "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": "gLpsttnj4wFbgc5Gu", "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-1-8 20:47:56"} {"_id": "Wqc7xBpBSHmETiqrR", "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": "WKvLffvqZAqDFuyL6", "msg": "This expression failed to be typechecked line 55, column 17, filename=/tmp/alloy_heredoc13940581018910756130.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 20:49:13"} {"_id": "JQXyHL8NzmM3fW7Sx", "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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GHBX9SaQhPF4wsC2H", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:31"} {"_id": "HBYrH5JSnmPcp5wbf", "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\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7S9We4xQsqQg5TFXg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:20"} {"_id": "6RX8Bom2KgbnwXYT2", "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\t~((Student and Teacher) in Person) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "boAwNi7GeaBfQTzFi", "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-8 19:47:45"} {"_id": "RqESXvTFcu9i98GPt", "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}\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": "rjBwxeM93Brid9Dm8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:33:25"} {"_id": "oGB4BrJwrdH6MRGr7", "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) & (Teacher.Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o8Fm8433ub6mHAAiJ", "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:56"} {"_id": "dfF952ky7MBAbSmy8", "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 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": "7TFghSDas6KaNmKqp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:13:14"} {"_id": "qAgcWhq4swn5b7kbq", "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": "LBYGuh7yDtZfncmQE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 22:00:53"} {"_id": "7DkaPxfuwdd3moRyd", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tSPpZzxx3PMQHcpXE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 20:56:40"} {"_id": "m62h6dgptosA2SJCo", "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\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": "Zmktz3PeTfhzeCJ5Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:45:42"} {"_id": "SwCCgGnP4M3qQ7mqE", "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": "n4x3Gi65N4HibmXS2", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:06:14"} {"_id": "JihHaiHCefwukfYdS", "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": "rAEP5RfnyzgLRvhNi", "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:27:27"} {"_id": "fMsHHWdmzZvdMPGku", "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 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": "sPXSwD9yZdktLbQd5", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:46:04"} {"_id": "3hHE9xBjHqLPEHLcp", "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": "NJWR3up8gKFZSGqYm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:03:06"} {"_id": "eZ4WQJ8iX2SFKmrS4", "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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:30:36"} {"_id": "F6YSMZ6iKSQApjDgR", "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 implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BPdwmDGTcM8TWPGwj", "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-14 21:22:27"} {"_id": "eMbyi8WTNCBJuTAAH", "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": "PpJ7axbzM4HEAo2Dx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:21"} {"_id": "uCuhzw29eipEyvGSK", "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\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->c 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\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BhxWRcMF8RJhSHvnt", "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-22 21:45:25"} {"_id": "a6cbPETK32MGrZs8A", "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": "CH2YbSWct8EGWAxGw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:05:42"} {"_id": "DizvDv2ivDhNMkt8Z", "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\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\t(some 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": "MeXaeo2xueQHXRDth", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 16:02:51"} {"_id": "JTAQSrQ3pydKMXiii", "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": "S9Ee9RRtHc3KG4NLr", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:50:28"} {"_id": "p6qGQyEfSM9WoJdtX", "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 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": "xCNSmcsXXc7Xd6T6Z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:20:44"} {"_id": "qywjP8BhjeNwGCnA6", "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)\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4pcJcuE3362727hqM", "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:56:55"} {"_id": "swEFZKYNdRKammTgk", "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\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": "tqyS5WafzscijLASQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:42:42"} {"_id": "FwNWmzoZ3gwvQ9Hxe", "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 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": "xoXaHFvz8bid2y9TW", "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:45:14"} {"_id": "3KAFJTQJzSGGNZzY5", "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:48"} {"_id": "ymsBKctfpEh7WTKCx", "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)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gZsDeRJZT4Xmf9A7P", "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-15 21:18:49"} {"_id": "gaTXBoCGSStvmTbZu", "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 some p : Teacher | some p <: ^ Tutors\n}", "derivationOf": "kBPyg5dS8ehZFjBqX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:35"} {"_id": "ZCnzPQeLRCxmypR3L", "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)) = (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": "dsWvMdLLby4CKsrf3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:50:05"} {"_id": "wcFqQX6unHPwZD3nH", "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 (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": "sbFs34c77PuQhrbxn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:29:25"} {"_id": "8Ez9B9RuQgjfwhDvd", "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": "LSDopiAXnmSKaQg8M", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:35"} {"_id": "zXDGFCNS8phT7jfFG", "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": "cHbyNcE8AyK9dHqyA", "msg": "This expression failed to be typechecked line 55, column 17, filename=/tmp/alloy_heredoc11640431405751052443.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:49:08"} {"_id": "XSuTcHkBMJtnCp2fP", "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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bqM3XJ2T5bdHaEGkD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:12:27"} {"_id": "CQLFLor6fDaTR8D4a", "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\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\tTeaches . ~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": "rcePzetNt6TQZryfK", "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": "2019-10-3 10:13:25"} {"_id": "hTJRdZJmGaDN5Tg89", "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 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": "ckYphFdKhsAqAcaai", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:31:00"} {"_id": "BakvF98aDQBSj7pzf", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * 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\n\n\n\n", "derivationOf": "ictWbFA2zEdrzXEcv", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:44:24"} {"_id": "fhApuguZ8mgX8Xn9F", "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": "ogfSBt3T6F5FodtRE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:40"} {"_id": "FMZjhB3MS9tMPJHxW", "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 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": "Y4FJ3nTCAtiZqqZNQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:38:29"} {"_id": "F7xvPYSeXx2Sjsa6N", "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": "FFjJXAur3YAJFfbJz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:32:04"} {"_id": "hJQpdTAjdGerqhbAc", "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": "kXYfstaL9f2iG5fy6", "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 19:54:16"} {"_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": "C4KNsmiqMoZNbimah", "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": "oBYzBzYWfbSRzqhv9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:21:52"} {"_id": "iqbAgGGHgARZtMoSM", "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 = Teacher + Student\n}\n\n/* 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 in 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": "NMdqjrF7Javbi3Ro5", "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:39:22"} {"_id": "Ld7ngJNmA9pFTmihX", "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": "agziM642WbcFJzbTf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:18:30"} {"_id": "tGqdo2eYJvm2fbo7K", "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": "jSWugJwXyfJxGZut7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:30:27"} {"_id": "ugFrJrMKc7QoiaKSA", "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.Class = 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": "Syt3dtbNdhgSqJ6Jt", "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:16:06"} {"_id": "RmDTKL5JjyQhrXT2S", "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 = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes 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": "vS4pZLiKpwmFeiBsG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:42"} {"_id": "FFjJXAur3YAJFfbJz", "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 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": "2fnt32ozy5BMzJ6hM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:31:52"} {"_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": "sGfK7xh6RjKSDe677", "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": "tMev7Pcqx6ofjGgcY", "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:15"} {"_id": "GtZBHLjcSWWFg9G4J", "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 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": "fqaeMP9FxqFKzKs5N", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:39:33"} {"_id": "BAb3Xo2x9G57JSoob", "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": "wrBsTTuRwWrsBYqxg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:54:37"} {"_id": "XmKFQXMcH5YYkuDh8", "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": "bGW2AWaoq9mLtW9mJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:08"} {"_id": "QPgsAvu5jzKDJ5uS9", "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 all s : Student | s.^Tutors.Teacher\n}", "derivationOf": "WWjrFsqFxo28ZQgMu", "msg": "This cannot be a legal relational join where\nleft hand side is s . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:16"} {"_id": "LaW7sMp384H4kBuFt", "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 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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YJf6YEBxFkhQq672P", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:27:48"} {"_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": "XZLvjj5BK3CcGDwmi", "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~(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": "f9W3oDKyTee6qdyij", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:45:42"} {"_id": "zbfuG5EM9JYdyBQ8u", "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 = 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": "HPrCE9kPoGGCYu5LM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:28:20"} {"_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": "iMNQpDbf9srCaw92J", "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": "9nqWAmtWpCaprEPyT", "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:19:50"} {"_id": "SNEfTyWEjM3Hf53Qx", "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 & 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": "aicWtbRScCfLZCxPJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:46:12"} {"_id": "ytofFgiNnfsB9zsxg", "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": "rDcv995uuDc3RdZGt", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:56:57"} {"_id": "MPJ3x6338reEKcMg4", "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 - 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": "mYxKkFLuh2jgcMffd", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:45:06"} {"_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": "4GqLBRBAXp8rYzERY", "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 some (Teacher:>Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tLnuhC6RSixt5PAQP", "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:46"} {"_id": "DpDbrpiZf3FveJ8dm", "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\t\n Teacher.Groups\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": "ZSB2MxF85jhBSS6nn", "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 10:35:50"} {"_id": "XGLQbGbaWinhGTX4N", "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 . 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": "2sGFSR8YPrvogFfdp", "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:37:21"} {"_id": "2NrwYC6cwxJGcTix8", "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 = Student + Teacher\n}\n\n/* 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\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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-10 15:17:18"} {"_id": "ictWbFA2zEdrzXEcv", "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 not (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": "arbWQKaxEASguPEZh", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:41:07"} {"_id": "JMwCGnuZE3B4XrXZd", "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 all t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome (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": "KNDHz5ZREY7hdvHo2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:33"} {"_id": "EENKfhoz57cJxqgtu", "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 and 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": "EyuYXPkHReJDtfrJt", "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:21"} {"_id": "jPA7MqvBA4WgDPEFi", "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 | Teacher in (p.^Tutors)\n}", "derivationOf": "BjozPSYpbLkg9qZ7R", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:52:06"} {"_id": "z5ax4XGRN2Bh2yoM8", "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": "bvcqtmzjR5ybgS3on", "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:45"} {"_id": "tCiAJsppcrWaMXhuZ", "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 implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xMDA3tTBaRPKEebqc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:03:31"} {"_id": "jZGkgLwaHu2ge2iwW", "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\t\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": "ubYKQ7vwxBuLcYGGu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:49:25"} {"_id": "2f93c9YJTSSaH5dGf", "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 (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": "Zti3djkWftA6j7hd6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:28:52"} {"_id": "Ri83ejebhGYF8MCjq", "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\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\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": "TFmjH2E4AqswcufEg", "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:21"} {"_id": "cwQKxwPb7mayMyGGL", "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 \tTeacher.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher.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": "tSNZp8PK4kTgR4ZaT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:21:37"} {"_id": "TBD5FiFR6MjyRr8A8", "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": "ZC7oFhZ6Y4doGrhJJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:39:01"} {"_id": "vLQ6mmH23X6DdjdsW", "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 :> 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": "Hh4SJNWP2bpxNazpb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:33:48"} {"_id": "eoDz4rLRSzPkK2cLD", "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\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": "b3FdyqZahqoYohztF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:41:05"} {"_id": "fEdNcMmsPh4cen7av", "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 <: Persson.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": "KNZeLWMFhWt97zexb", "msg": "The name \"Persson\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:24:51"} {"_id": "WdHpYeCLudKvfJdj8", "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": "Y9utakyoKP3BDycRK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:27:36"} {"_id": "7qh4wB9maFrrjcA3a", "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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-7 13:45:13"} {"_id": "7S9We4xQsqQg5TFXg", "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\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8hxjXpvGY3mCgmXDb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:10"} {"_id": "rxFErJGTWjdyFW7Ph", "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 Class: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": "w2MjoYBwzDfuYxfbL", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:45:06"} {"_id": "HAFPAXwtsqsggHDqK", "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.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": "6tRuahdqtd2SYX936", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:19:15"} {"_id": "nMXDACSwZXheEuqTs", "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<: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": "2qTjn3LtoChyML34D", "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-22 21:09:20"} {"_id": "6u4qavCndw4zzdYKc", "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": "n4YxuL6fio4qsxa2W", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 20:55:24"} {"_id": "uGNqpqbFaDDj4H8qK", "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\tTeacher.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": "jjR8h6DRo8CJcsWDY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:30:22"} {"_id": "7TFghSDas6KaNmKqp", "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.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": "8oPXTChkNZjFK9jES", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:11:58"} {"_id": "9waTMebM2XTrbXZKo", "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, c : Class | some s.(c.Groups) and some (Teacher<:Teaches).c implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mj8iYxPePpL2n8AZi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:09:34"} {"_id": "ccJkoctsWzrzQ7SR7", "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\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": "pMwbsv9CvBzNs9SMm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:09"} {"_id": "BAssa6FJFdxhQKXi9", "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 \tPerson.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": "LgPh9KDjRrAZb5yad", "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:15"} {"_id": "dMHJogRN4zasaxXEY", "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\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\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hq8ZpBHS227Bdp4XH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:43:05"} {"_id": "NBCD7XswDd846zbzm", "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 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": "tehH5MeETDQnqCLkp", "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:35"} {"_id": "TLt28fMhdibvMsCtF", "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": "skaFoFusDP6cLpKmE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:27:46"} {"_id": "vCJvzpNDPgoWbg5nY", "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": "rYYTCigPGWWkWdaPi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:58:13"} {"_id": "GmZkBD4Ci5FqE9y9G", "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 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": "yd263oaiZcsjfHZfn", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:30:20"} {"_id": "AA5BG7ZHtPErqAdAa", "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": "8DDYYnhpXsbKkbZ2N", "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:10"} {"_id": "gwsobXPCiFDrTD8Mf", "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": "Guqye6EHTNpCDiwqG", "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:41"} {"_id": "NwTeA38iCySi9x9nm", "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.^~Tutors\n}", "derivationOf": "T6uf6z2QGjW6GCgpR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:38:01"} {"_id": "oyunMsrXwWAaEodwt", "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\tall 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": "HxYQbvaBidJoAYLcC", "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:30:00"} {"_id": "dox4emkYZYP5E5hc4", "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 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": "pKG9voZDFNwKrt2EH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:50:51"} {"_id": "JkeSHZDN2uAurZCDN", "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 c:Class { all s:Student { some g:Group | g in s.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": "6x9jAsdWJudzPkz4a", "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-11-13 04:17:40"} {"_id": "dy3j4wXGWsq54LDRj", "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": "7KaRtj4t3cBg3rvfv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:10"} {"_id": "ES27GTTGeW5d2nrch", "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}\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\tall g:Group | some c:Class,some t:Teacher | t->g in c.Groups and 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": "AR7XBvrCQ5eoCLCJj", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:49:04"} {"_id": "fvpvJzNxN5PsWCtAy", "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) 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": "RK8wFGaCY22SzBLwD", "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 11:43:52"} {"_id": "8sPB3s2iaJhLEFSnY", "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": "3Daq8GjWd9p5sZhyA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:48:52"} {"_id": "YP25M5k9harx6S4BP", "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 some (Teaches . Class & Teacher)\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", "sat": 0, "time": "2019-10-3 10:07:30"} {"_id": "rubyjizXRqvbwv6yn", "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 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": "zJCzeo6cgvaPFREWB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-7 19:41:12"} {"_id": "g8eQgoLWtHQ4aFFKM", "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 not (Person.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 all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "KDje79kS9c5iMHFuv", "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:27:44"} {"_id": "mpDShe75WhbJ5zb6X", "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": "XQgxKXtHDAH78uNez", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:15"} {"_id": "8e9pvi4RDhxDMTFqc", "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\tTeaches.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": "9rSNvbttx6YrmeDK2", "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:30:37"} {"_id": "Zkr95fyTB8RsZSHgP", "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, 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": "C4KNsmiqMoZNbimah", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:22:48"} {"_id": "fZi5onQS3aysSqhme", "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": "srpNYKn2gBzJHmmEx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:39:58"} {"_id": "GmdhCe4J5CjayEMNh", "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.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": "JmWXRnhdgL2Ro5wQN", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:26"} {"_id": "5nEkxLgE9nudETWe5", "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\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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LkC9WcRwvSWDbB2qa", "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:32:42"} {"_id": "Z2idsnsbPFdMJJtWT", "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\tlone Teaches.~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": "MDETKLEvRWXTxFGBK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:16:45"} {"_id": "4sS6HiM5KyhapPTQm", "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": "kPdzLWEwpD2T8uJYy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:04:12"} {"_id": "Tt67q86cth2azLS8n", "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": "pW38N4qxyqSHsCkeS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:10"} {"_id": "b7Yroat5CXNwxYz28", "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": "Ta5zPgnxhZKeJdtrk", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:27:24"} {"_id": "HdYsYxzfz4PScKT3c", "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 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": "N3pA4AiHKukbAhZss", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-14 01:44:22"} {"_id": "zyio8uTqWt5SX3AYs", "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": "XLDnsRwknzYTjTwc8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:59:38"} {"_id": "D7mPnkgNdC6QRbaFq", "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 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": "sAHTH6LbmHaJq9QPb", "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) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:42:46"} {"_id": "5MtmBXpjvP8nsTBsN", "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 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\n}", "derivationOf": "WpvbwsKMDcbdNKaZX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:49:57"} {"_id": "Wfu4tMXyEhFmBt772", "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": "E3tysNAwu2ExivZCa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:49:57"} {"_id": "WmfLyGjBvdn58kyNp", "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 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": "RcWmzvr5fFtTyPEww", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-9 15:21:21"} {"_id": "JmWXRnhdgL2Ro5wQN", "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 . 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": "HH4zK7s4ffp9PsGKC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:32:31"} {"_id": "LQDKhozHQYMivuN8P", "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": "2019-10-3 10:05:28"} {"_id": "w7Dp3PuiMGXCpTMks", "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 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\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": "RA5vuTfvufHHuLi8v", "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-9 15:31:38"} {"_id": "cryZWpmJixRhXCcHk", "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 Class in 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": "iXbKhShiNKMxgKoti", "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:23"} {"_id": "k7ZTB2GGEjcDDoLh5", "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\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": "w8haoiKJQA8XmSnXm", "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:11:46"} {"_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": "Syt3dtbNdhgSqJ6Jt", "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.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": "QPMf5GZpce7cxSXBA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:58"} {"_id": "LJkWuzQv63x2W7sjD", "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.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y9553KTKHo9LDyXgb", "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-14 11:54:59"} {"_id": "t5fv8WMGKRac9GARv", "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.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": "kdkgJRJENaz4SRGZg", "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:59"} {"_id": "q6FatZC4WgBer4nNA", "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\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZdYKzpa2ja2vujyc8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:07:31"} {"_id": "cLWkiQAtCFdk5Gjsh", "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\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": "7X44J3ABgqKKLpiEE", "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-22 21:47:22"} {"_id": "TFmjH2E4AqswcufEg", "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 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\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": "MJm5puAiLmeX6aLvp", "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:26:59"} {"_id": "kcQE4jjsvMgJD5NA6", "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": "x6jfGtwiDGtubPkdM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 14:43:23"} {"_id": "544zbqRpFaMWnK7Pe", "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) & Teacher\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": "acjb9eCYFHcD5oapZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:31"} {"_id": "nRbMueQKHQdERS9Lb", "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": "8PNQNgQkRNSi24vBg", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:39:29"} {"_id": "cp5fhRjgaB8zQYkpF", "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": "pW38N4qxyqSHsCkeS", "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 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": "JvCotHLZhRL5i8cAs", "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:38:02"} {"_id": "dqKR3JYr62ZwhT5AA", "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\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": "YiRaewrj3urYXmtiQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 20:46:35"} {"_id": "2PRK3xaide8jb244B", "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,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": "Ls5iM8HJfE87je6w3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:41:17"} {"_id": "dtYYYnHikYSG2vmdA", "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": "QZvJz4WiWXeSuvE5p", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 10:37:42"} {"_id": "ykBv34LrpgtN2D6Fw", "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/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\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": "SrKbtSyPkb9oGbfEj", "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:14"} {"_id": "NMdqjrF7Javbi3Ro5", "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 + Student\n}\n\n/* 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": "iL6KW2gG27mfiPDnd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:38:12"} {"_id": "TYhEjzui8AFMoHkiN", "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": "8Ez9B9RuQgjfwhDvd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:55"} {"_id": "6NRo92byZLAiLrwMz", "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 & 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": "zRAn69AocpkmxXZnW", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:22:37"} {"_id": "Tb3Q6zogLNHMGzELv", "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": "XsobEj5NvejkB5dER", "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:46"} {"_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": "tLa4q9AvtNtTLZRuC", "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\tsome Teacher & ^Tutors.Person\n}", "derivationOf": "Ky2roms7QD782KomY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:22:08"} {"_id": "2hEdAxPZtxcSXpWgP", "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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7DkaPxfuwdd3moRyd", "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 20:58:32"} {"_id": "7yATogT8jEuEECygT", "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\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": "fhApuguZ8mgX8Xn9F", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:18:26"} {"_id": "TMbFtbXBBAovi5jHY", "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\t\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": "yEi2xTySCfM9aptC6", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:36:35"} {"_id": "XG7tZDiKfHJckmFut", "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": "bwk9xhxJJjxND2z3s", "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:18:21"} {"_id": "QT9gSGLumTQwTPW7H", "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.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": "ugFrJrMKc7QoiaKSA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:13"} {"_id": "p8sgQiJ7vSkN5Lx5B", "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 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": "x5Hm9eRW6KZjTcDTy", "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:13:20"} {"_id": "qpbDnGM5i9zLJpozh", "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 implies 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": "N6ZD3sNQK9CB2kBWh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:42:30"} {"_id": "FwzsxLSG5JAcLKegr", "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": "kCPwdJHYRXvN3MFuc", "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:59:39"} {"_id": "98tfdJJKLMsZYzQaF", "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": "vHpEjyf2sv6zTPrfF", "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": "2019-10-15 21:08:54"} {"_id": "kPdzLWEwpD2T8uJYy", "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": "tCiAJsppcrWaMXhuZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:04:02"} {"_id": "HPrCE9kPoGGCYu5LM", "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\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": "btWBYjZCfqkvD23n8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:25:27"} {"_id": "vwRdYHnxh2kdFCogN", "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 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": "oMMQnSkxtN9SXqRgD", "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:13"} {"_id": "skaFoFusDP6cLpKmE", "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": "v84FnHh4pYWwxym9B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:27:28"} {"_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": "tqyS5WafzscijLASQ", "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\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": "Jav2YK3Zbo3Zok5Sf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:56"} {"_id": "wzxMmvGbgsLrwSFLn", "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": "svznANkaFqkpvrxTW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:50:39"} {"_id": "4GfwamLRbBT2F9MSM", "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 not in 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": "8FL7KW8kYoh2G46tG", "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:37"} {"_id": "9ATvastxMvdsRBCZS", "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 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": "gYXyjnh7KGaDkMBJi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:52:14"} {"_id": "LMAD5ddfE9A8JfPLj", "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": "p9TnWjj7yppiHhJrF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:01:22"} {"_id": "AfMMA2FysiHSGdWkf", "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 \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 | 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": "etkMEaDFpiJF2smYp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:20:40"} {"_id": "oZsHoTaj6Ngr84WRn", "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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:24:25"} {"_id": "oRay9fhFptL68b7sF", "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": "ugwdAPEsCBWjTEhzx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:35:31"} {"_id": "QRjjmrYShCPHyzpHX", "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": "i2jpPiRvghAomKu8t", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 20:50:54"} {"_id": "6A2cdKB8C33w5EtDG", "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\t(Person in Student and Person not in Teacher) or (Person not in Student and Person in Teacher) or (Person not in Student and Person not 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": "w24Czr9dbCAx5k9YB", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:35:50"} {"_id": "sD4bXoGmzFDfLmdXK", "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 + Student\n}\n\n/* 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": "RbCPMPstCGiyyCZzJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:26:42"} {"_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": "dHyi3Nq3ATp62vM4K", "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": "yRE9uSGN62MZH5N4i", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:25:00"} {"_id": "eSY9ftKL3uSYxD5uo", "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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5nEkxLgE9nudETWe5", "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:34:03"} {"_id": "YQ8P7rhXLH6KnWDvt", "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 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 (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": "uBa798JPbaZizmqNy", "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-14 10:38:51"} {"_id": "85XS9FsXZENnAf2pH", "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": "tpR9pzbuXcBFTaQCK", "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:58:44"} {"_id": "hweR8unvoiyjxK2dZ", "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 16:20:20"} {"_id": "9sLgLNzLW7tgSrTu6", "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": "LBNZdXFF7G3epE9BJ", "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:29:09"} {"_id": "KcAW9zcoeP2RZCZpx", "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\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:Teaches | lone t in 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\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": "jRJDxCjmPivftB9rx", "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-22 22:06:45"} {"_id": "JNraTPkAtvxb2nDn2", "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": "acedvBCsAvSBgzcxq", "msg": "The name \"teacher\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:32:45"} {"_id": "vw77L3AMNrjsgWtiX", "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": "cibNhhqbR4N5C9reu", "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:22:56"} {"_id": "ZrAt7WNSzrZaSzveW", "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 no (Person.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 all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "g8eQgoLWtHQ4aFFKM", "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:27:50"} {"_id": "XApGf8XkKFCriGxgH", "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\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": "wajupNhrhZWTnza7F", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-12-8 11:58:04"} {"_id": "YbvvXEMot9i2hw867", "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 | one (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": "YSW579m9pRKSqWp2f", "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:26"} {"_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": "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": "sN2zTGP7zo2xvkCfK", "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.^Teaches\n}", "derivationOf": "L6qEtq5yEF7oGThho", "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:13"} {"_id": "8JTqXC4EcYeZGh5pN", "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 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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eTyAxEo2P36v6sCPc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:43:02"} {"_id": "9CXbM8gka29vHXcHt", "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 (tTeaches).c implies some (t.Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "98tfdJJKLMsZYzQaF", "msg": "The name \"tTeaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:09:00"} {"_id": "zffcbwEE2SmZszLWS", "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": "yp8A7jxEgNF7wvB9m", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 20:57:54"} {"_id": "4pcJcuE3362727hqM", "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": "YZW2wkLFaYgjjPoKd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:55:54"} {"_id": "nR86FWvPJ5eXRgBje", "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\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": "b43rJmKKt7nyjPGqv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:10:32"} {"_id": "rAEP5RfnyzgLRvhNi", "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": "3G5BRFPrYMReAirJ6", "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:26:51"} {"_id": "RfXzAzs4H2Jfuxb2q", "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 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": "CKW88ST7NskWD8o8H", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:34:07"} {"_id": "p8sLK6Fca6HbqdxCY", "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": "Qqt7FLcDGkuzHFKEm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:44:14"} {"_id": "zwAhh5ngKBdGnS4GA", "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\tTeaches.Teacher 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": "GayMWWz7M6P9rckrT", "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:15:31"} {"_id": "9rSNvbttx6YrmeDK2", "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": "LaW7sMp384H4kBuFt", "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:29:29"} {"_id": "sPXSwD9yZdktLbQd5", "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 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": "qdyLuMFK46yCroaR8", "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:45:53"} {"_id": "h7rsE2tiqCpAMzZr3", "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,p:Person | some t:Teacher | some c.Groups.p 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": "PyzgaKchdQKh8GoXg", "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:41:55"} {"_id": "kZpHRYZfGJeyGXsif", "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.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": "DLiwqwpWDco56urGp", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:50"} {"_id": "m7AwhSdw5xMsdYCSZ", "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) & 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": "3B7WzycPsERzj4W5Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:49:37"} {"_id": "n4YxuL6fio4qsxa2W", "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\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": "kYZt25X3m5WQ8vETd", "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-22 20:54:47"} {"_id": "sFPFmfpWqaTTw87wp", "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 | (Teacher <: 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": "GtZBHLjcSWWFg9G4J", "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:42:43"} {"_id": "nmuKyJpQg6gphMC5E", "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 | t.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": "arMyWXqeewLJ3CQTS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 17:28:19"} {"_id": "ERmxdaEKz5RRMZLmd", "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 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": "HgBHZ9mLH5M4SZSHe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:32:05"} {"_id": "Ky2roms7QD782KomY", "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 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\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": "Tjx75WaFmozg4Y2jT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 12:12:47"} {"_id": "AexwC5kCrsvoe5D7p", "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 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": "dMY6ShZLc2oh6zfKj", "msg": "The name \"if\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:38:15"} {"_id": "SzAi9QGhoBzjuAJju", "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": "HJJFhqoZriCCoJvx4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:01:16"} {"_id": "sqDS4cRzZPqSBxXh2", "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": "9k7TRebTh2q2HcGWM", "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:16"} {"_id": "yp8A7jxEgNF7wvB9m", "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) implies s.(t:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hj8LKuGASDLeveCg4", "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 20:57:44"} {"_id": "AaCcWCMTSpnGNxG4j", "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\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\t(Teaches . ~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": "CQLFLor6fDaTR8D4a", "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": "2019-10-3 10:13:39"} {"_id": "gkYvPJq6aMHLmaDHB", "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 = 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 Teaches 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": "XwiGQMfWQg9CEH7Dp", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-24 09:30:00"} {"_id": "SDo3u2eirZJzec9g6", "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": "nRbMueQKHQdERS9Lb", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:39:39"} {"_id": "NwtHpTmAAuXrMPLkW", "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\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": "6EMfWYPfsw5AwFdj4", "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:14:48"} {"_id": "hDDuqAKL2yzAxK5Si", "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\npred inv6 {\n \tTeacher in Class.~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": "p3QS5KfPNvdLznR5g", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:37:09"} {"_id": "Wbvv5ZXGXLn8MmaNp", "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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pS2KXPmY3vQm7mfsr", "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:13:36"} {"_id": "ChLA8kpTRtSTebiQz", "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 \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": "rfuumfYnWeEk5LDiv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:35"} {"_id": "YNKqY43GZj9Cfvz94", "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 all s : Student | some s.^Tutors.Teacher\n}", "derivationOf": "QPgsAvu5jzKDJ5uS9", "msg": "This cannot be a legal relational join where\nleft hand side is s . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:21"} {"_id": "6o44YRDwfvenQNNte", "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": "zSua77c6qd5TQeYc2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:17:04"} {"_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": "uBa798JPbaZizmqNy", "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 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 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": "dtYYYnHikYSG2vmdA", "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-14 10:38:41"} {"_id": "GoP7JJLocvp7eh4MB", "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": "ge99oDJMwrnYNSLpG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:55:13"} {"_id": "tNkt2Gm5mnf8rjDfY", "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": "gwutZAmPDhdv53HFr", "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:02:53"} {"_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": "LnpD9uSGm3nkTQDQi", "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 | 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": "2mz5E9FvbtyP3fxsb", "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:36:09"} {"_id": "6x9jAsdWJudzPkz4a", "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\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9f8gGqBASDMD2ZRdH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 04:03:27"} {"_id": "vTxm8ohcbTmm2pnRt", "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": "gttkub2TNM7FH6bph", "msg": "This expression failed to be typechecked line 91, column 34, filename=/tmp/alloy_heredoc1989145767134761507.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:40:45"} {"_id": "HH4zK7s4ffp9PsGKC", "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 . 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": "jBLRMzvBMtsJLZoDL", "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-3 10:32:21"} {"_id": "KeEPL6KkCv8qFpEpS", "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 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}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5BQsdo8PWog2xQxbE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:30:00"} {"_id": "fTCdb8iKqqacEwLrs", "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\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": "iWazdZfDpBm4GA79Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-30 01:19:51"} {"_id": "sAJouRJA4ccoR9rgs", "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": "XZLRoywF8WQAa9PHy", "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:28:01"} {"_id": "8hxjXpvGY3mCgmXDb", "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": "q6FatZC4WgBer4nNA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:07:36"} {"_id": "nvGXGye5m3tDQwC87", "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": "smCgFKtp5PhiqYE85", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-30 01:14:35"} {"_id": "C2pzim5KD9kh7cBjL", "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": "D7mPnkgNdC6QRbaFq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:43:06"} {"_id": "55aF7XfyFg53avcxB", "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": "q6Jx2E9fiMMFhmcPW", "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:00"} {"_id": "gdJRhqbkqSpzmmaCz", "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 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": "7qh4wB9maFrrjcA3a", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-7 13:45:21"} {"_id": "6tRuahdqtd2SYX936", "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.Person = 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": "QT9gSGLumTQwTPW7H", "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:17:49"} {"_id": "CKEvbobowdeSt8zeM", "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\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": "ghx4C6ZhzuGTrXh5A", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:26:40"} {"_id": "fxQwSgbLTGZWgepdq", "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": "uD9vnzY5vL3bNe5t6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:29:46"} {"_id": "k4NHYqgWAmp5DvWmp", "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": "85XS9FsXZENnAf2pH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:28"} {"_id": "ejSpMykc6cTPZYFPW", "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).Person 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": "fQuN2xm92RXQtnn3v", "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/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:40"} {"_id": "3NEu3HKy7GqCtGREa", "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": "dQ8n9McArQrSN6Cqj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:02:28"} {"_id": "byJvKnxp8rMFsfDYv", "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}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7ymZ8LsMiQyGKb6pT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 22:41:28"} {"_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": "u27T9LE6M4AnnPyv2", "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 {\nPerson.^~Tutors 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": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-11 11:59:56"} {"_id": "Fjz5PSnzpXQdeQ6MQ", "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:06:55"} {"_id": "bkXxHgpfFFdEpG7mk", "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\tClass.Groups implies 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": "WDMQLm45QyK47Nu9S", "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:45:27"} {"_id": "ZC7oFhZ6Y4doGrhJJ", "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": "vfxnhzkTqQMznmTLX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:36:07"} {"_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": "DCpBsuM742MEW6uJQ", "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": "H29MT8aJkG4NBRMeN", "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:36:02"} {"_id": "pXyNnKcR4i84XmrHg", "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\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": "9ayJq7NT5LqNJXN8f", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:42:51"} {"_id": "9k7TRebTh2q2HcGWM", "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.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": "hHCngteWcsFHmRAM9", "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:49:02"} {"_id": "oX2yp8whrkzpGWMNt", "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 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": "MoBdqG4htkafKJ48h", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:32:04"} {"_id": "oXxN9B6sFAu2me8xa", "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 Student & Teacher\n}\n\n/* No person is neither 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": "XwiGQMfWQg9CEH7Dp", "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:11:15"} {"_id": "rz4CSt9uQFtj9SsTr", "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 \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hyruo6oHtv7y9pneL", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:50:55"} {"_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": "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": "uGLDX4buEtWreMThm", "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": "YL7mrpsFe8aiRbWKw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:24:16"} {"_id": "DqokYkk7Z92SZ5atR", "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\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": "dsiT7fmoXPi7wC7Wx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:35:29"} {"_id": "x6jfGtwiDGtubPkdM", "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-2 14:43:07"} {"_id": "bqsRCSZ77Jreurv2f", "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": "RoreoevkE3qf3y527", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 10:39:58"} {"_id": "yDTxe7vkcWNerQTTq", "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 | 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\tsome c:Class | 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": "2hEdAxPZtxcSXpWgP", "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-1-8 21:01:51"} {"_id": "jRJDxCjmPivftB9rx", "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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4sqqiDiZHoZDYYyYw", "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:21"} {"_id": "bc6GBZEbYxWMAD7e2", "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": "pLGRHASHwEqeSBxcc", "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": "2019-10-13 20:08:18"} {"_id": "XNYhKWQ9F8e5s3qXF", "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-1-8 19:41:07"} {"_id": "a9foNbfGYBBtfCrx2", "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 s:Student { some g:Group | g in Class.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": "LomTZu38X6SK8GnG6", "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:24:34"} {"_id": "PKRXf4LWpsQgMKhJC", "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": "oZsHoTaj6Ngr84WRn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:24:55"} {"_id": "xbjhF2EFuNktJvn6L", "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 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": "sAJouRJA4ccoR9rgs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:29:44"} {"_id": "TjDc2ybC6z3492tNi", "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 Teaches . Teacher = 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": "RbjdF6NpiwoCBjwRc", "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 09:37:46"} {"_id": "KNDHz5ZREY7hdvHo2", "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 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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sqXzqh9KisFBkZuWr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:23"} {"_id": "sAHTH6LbmHaJq9QPb", "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": "F4WDSLMQ5Ruzc2XFr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:42:08"} {"_id": "gLcAMYi7H8d4N7FEB", "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": "KS9FurBWkpLFJCdXL", "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:43"} {"_id": "2p9GaeA3Hb7XuuXYL", "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\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": "SpKLLPA4D9u3hLW4s", "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:13"} {"_id": "G73bdGt9vWxBMWHzM", "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": "BxnLapAWPXM7jgkzi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:49:30"} {"_id": "wqKQvXHinPw5XJvmM", "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": "FTFn8Xd4Z4Yi9tZyi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:43:12"} {"_id": "withbSMoLmv4Wb9MY", "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 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\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SNEfTyWEjM3Hf53Qx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:47:04"} {"_id": "WWjrFsqFxo28ZQgMu", "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 | s.^Tutors in Teacher\n}", "derivationOf": "FErfKybKB2eBAzh8y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:56:31"} {"_id": "JGHGvRc3DsSiMSwha", "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": "DSkgsm5hCsBAZtTYH", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:48:42"} {"_id": "t2PtawfSKuoZ77dgL", "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}\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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3yBvaESwhaaTnnfNk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:30:38"} {"_id": "rLmPwdvxNocFhxWdG", "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": "mpDShe75WhbJ5zb6X", "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:12:44"} {"_id": "pKb4aBoPtzjzgAfdp", "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: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": "DmjGNXnRnQqDTguXo", "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:35:52"} {"_id": "uJjD85LnYooLsqJBG", "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\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": "TBD5FiFR6MjyRr8A8", "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-22 21:44:46"} {"_id": "S2ZZRrESw9XFajQKe", "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 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": "qpGubtX9Qkru9MoXw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:53:49"} {"_id": "q24kqjoJhfpP9B5xt", "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": "XmKFQXMcH5YYkuDh8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:39"} {"_id": "qfzZovTYQK3Jz9Kwo", "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": "G73bdGt9vWxBMWHzM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:50:07"} {"_id": "ubYKQ7vwxBuLcYGGu", "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 Student & Teacher \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\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": "zYsEF2fcFT8HuuQ83", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:49:10"} {"_id": "5zquiacMdxH2eDC8e", "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}\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 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": "d3AZCBrejGbaq3bRF", "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 17:33:01"} {"_id": "57C3H7KQN9Gc9JWiE", "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 t:Teacher | lone t.Teaches and ~(t.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": "fwihxPX5jT3vicjWP", "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-15 22:47:25"} {"_id": "LW3koXCfuYTTACHwd", "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": "ZmLHK56whyyAZtoQg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:45:40"} {"_id": "rPLtFpNgL52Qyy54r", "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 (Teacher + Student)\n}\n\n/* 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": "ewjhiEPZ6JeLYphCw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:19:39"} {"_id": "scrtLLEmhMXQL4br7", "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": "hjF9Akgq6JHZvdinT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:02:15"} {"_id": "8ifDj9bS5JH2xofLy", "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 noy 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": "hQ65ZFd5jxY8Xf5bh", "msg": "The name \"noy\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:57:08"} {"_id": "PyzgaKchdQKh8GoXg", "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": "Eui73qPYg6GYLoXWG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:40:22"} {"_id": "beGpaPtnhaZ6k4MwP", "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": "TYyBFLn7CYBQdnRee", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:17:14"} {"_id": "Ncute8vRttGioGhLf", "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": "hCjQbZFtnpm7f4tAL", "msg": "This expression failed to be typechecked line 90, column 34, filename=/tmp/alloy_heredoc10397314920665646099.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:55:42"} {"_id": "Kh4avCcd8dPm8Pc7T", "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 <: 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": "osj3RRHs3chPsmrZd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:18:55"} {"_id": "Mgfu6kXybLiToedpR", "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 Person.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": "6snYhSRot4cDhw8bf", "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:07:36"} {"_id": "3z92aiYkxrHWRhKHq", "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.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}\n\n\n\n\n\n\n", "derivationOf": "SNekeADuS7HX29u2F", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 10:10:50"} {"_id": "3GxHrQfpXCq2Rrpks", "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 = 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": "mpNtC7vm5Er4SfkxK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 23:17:02"} {"_id": "2dZZ5szQszZ6AHk4X", "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": "fvpvJzNxN5PsWCtAy", "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:00"} {"_id": "rSGC8nyKqfiAGxrs6", "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": "kR2T55WAzZB2v2NLi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:11:36"} {"_id": "huc8qBZoimCzYp9pJ", "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": "oGB4BrJwrdH6MRGr7", "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:18:20"} {"_id": "npgBE3PAFdMJfqsnF", "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 Teaches.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": "smoHdfbebkbZQbZcN", "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-11-13 17:46:05"} {"_id": "i6sgmb5k8TCp6LcX6", "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}\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\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\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "EKfnad49YJwvfDHiP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:51:32"} {"_id": "5cwLZKyn7icfYa7Yu", "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 implies 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": "j3aRo6Zekk2WXbKpu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:33:28"} {"_id": "24Bsffg6bBgRFrKmZ", "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 | ((Teacher <: 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": "sFPFmfpWqaTTw87wp", "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:43:07"} {"_id": "njz7nCjwWEui9vRKn", "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 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 (Student <: Class.Groups.Group) in 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": "SLCXYNNuMtqHpbkQM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:47:34"} {"_id": "w6RoS7phXEE4ctiuE", "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 | some t.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": "rz4CSt9uQFtj9SsTr", "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:51:18"} {"_id": "9aGHkZFk73JCqjyRr", "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": "8ifDj9bS5JH2xofLy", "msg": "The name \"inv5OK\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:57:31"} {"_id": "arbWQKaxEASguPEZh", "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 not in (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": "4GfwamLRbBT2F9MSM", "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:47"} {"_id": "CM7LBz5iWGSuxqbET", "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.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": "k9QsgrRaCjGLyKJwK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:43"} {"_id": "QsSWZwG6y9gTsWbMq", "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\tno 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": "RWdN7m66cHXFucDSf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:34:00"} {"_id": "sqXzqh9KisFBkZuWr", "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 all t: Teacher | some t.Teaches\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": "2ZoqQi8G6w7BZwe6z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:09:58"} {"_id": "bur2mN9MSXsCZ4rBr", "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 = Person.Tutors 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": "QW6Xw86PGHcZQy5Z7", "msg": "The name \"Tutored\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:01:56"} {"_id": "svznANkaFqkpvrxTW", "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\n/* No class has more than a teacher assigned. */\npred 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": "a94u6iMgHunQDJzFL", "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:12"} {"_id": "bZrkrrMDxCdujcBxS", "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\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "34YKqLp28HsfvSJSa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:21:23"} {"_id": "e83hPJgfztCE8rjih", "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": "iTDEtu3SARohfay88", "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:35"} {"_id": "kYZt25X3m5WQ8vETd", "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\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": "vxPziRcfnoijHbHax", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 20:53:44"} {"_id": "8Dh4mc7xt8sjpMfsQ", "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\tnone 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": "LoRNZ7ivivJ5CoTAk", "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:07:24"} {"_id": "acedvBCsAvSBgzcxq", "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 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": "Hyj5EGxaEkaAr9RAd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:31:57"} {"_id": "AYQfBWQt7spLhTX7H", "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": "3J5ia2EDgKBjaDE2F", "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:43:31"} {"_id": "cR7xygwpxBouL8QH6", "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 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": "Mv6CNriM2fPe3a8sB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 14:54:50"} {"_id": "AWbuqrrRHaSrmPYL7", "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 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": "XGLQbGbaWinhGTX4N", "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:37:52"} {"_id": "swPGMK8oLTf7eThwD", "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": "PRqJoYm8K8RBDcu3F", "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:33:12"} {"_id": "cXES5J45dnsgYFuN6", "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.Class = Teacher\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": "RkzqidZ6vbg6DvGA4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:32:58"} {"_id": "RZ4PjCLLiwYhTa7dJ", "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": "suNtFoL3kLmjSDAZv", "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:58:33"} {"_id": "XQgxKXtHDAH78uNez", "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\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": "CQA3NZLNot8H8FKbL", "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:55"} {"_id": "irSGT3fpxCknJRNn4", "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": "SwCCgGnP4M3qQ7mqE", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:06:34"} {"_id": "Ae7zFJWo2yFgftWhz", "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 Class.Groups iff some Class: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": "rxFErJGTWjdyFW7Ph", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:45:16"} {"_id": "HGYtaGQt8xBxLLvGE", "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\tTeacher -> 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": "oXgt5CgHnzHvHoPbE", "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:32"} {"_id": "sraTzdHLZy8Nh8fMo", "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 = Person.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": "rHzdroGPTpxyYLdLt", "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:25"} {"_id": "FzXpDhSfWrSYSEKQo", "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 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": "sB52w23G4J5FWqrbr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:32:44"} {"_id": "xoXaHFvz8bid2y9TW", "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 => 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": "EgjkdFXcYuDtFoWGL", "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:44:41"} {"_id": "n2tv8qG2mCzTer4e9", "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 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": "zsDfkEzsqLy8gW5Mv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-4 07:32:34"} {"_id": "sxhH2b7avRk6NFjhZ", "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\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned 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}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:16:27"} {"_id": "bvfvYGfy8BLrBNSQN", "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\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": "7gHYHzqFGhRsnc7bX", "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-1-7 19:41:43"} {"_id": "qSTFaFoq3xNERTfyL", "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.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": "YEx9htQLEK45ZQiqY", "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:15:17"} {"_id": "jzNWLhj8DXaxTSxSg", "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\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": "KcAW9zcoeP2RZCZpx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 22:06:52"} {"_id": "h5pHJK3W3Et6PAK5B", "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": "7LLXuR6mcZMsaHvqt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:34:30"} {"_id": "BjozPSYpbLkg9qZ7R", "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": "7thPZrgj4vMABqZ8i", "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:58"} {"_id": "vPhrTnS8bN38bQHCf", "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-10 15:31:39"} {"_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": "r4ESJa6RENCqLzwvY", "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 Teaches.Person\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AokDqH4Rwdmnrs9rq", "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:29:32"} {"_id": "6Ayqdd75mvo7BQv8i", "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 :> Teacher) . (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": "a3KCXBKYdzmLnKnzj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:37:34"} {"_id": "TiubajaaZqSnkNXQF", "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 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h4vCDbDGBSoiBjbEK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:22:58"} {"_id": "xCNSmcsXXc7Xd6T6Z", "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": "hweR8unvoiyjxK2dZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:20:30"} {"_id": "ot6mpgZuvr3Cy78Ry", "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 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": "YhZ6Qjy9J5g7AGEj2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-14 01:44:14"} {"_id": "DXh9FmJPReQgRQBCv", "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.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}\n\n\n\n\n\n\n", "derivationOf": "jZz6nfGZDkmhBZkTA", "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:26"} {"_id": "pzr9FighazSyioGM2", "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": "ChLA8kpTRtSTebiQz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:38"} {"_id": "L7M4RWWhP7XDNCfBn", "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\n/* 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\tPerson in Teacher + Student\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": "XApGf8XkKFCriGxgH", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-12-8 11:58:40"} {"_id": "zKeBAZ9JCuzyeEFyi", "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 Teacher.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": "KWFHpsG3XWfFzva5s", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:18:46"} {"_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": "3B7WzycPsERzj4W5Z", "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": "ZW8yHbTyj3ofJpoJZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:48:30"} {"_id": "fwihxPX5jT3vicjWP", "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 t:Teacher | lone t.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": "XwiGQMfWQg9CEH7Dp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 22:46:44"} {"_id": "aKdAwbDnDvczEK8nj", "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}\n\n/* 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": "6u4qavCndw4zzdYKc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 20:55:29"} {"_id": "RbjdF6NpiwoCBjwRc", "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 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 <: 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": "v5pTzojCS5StFE36o", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:37:20"} {"_id": "pP7KSRuZLtYkCfiAr", "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\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "588AeQ4XQabFozG88", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:19:14"} {"_id": "5dmb4gMdxadwEEtCF", "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": "jdctFhbtx7HsB5aA4", "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:18"} {"_id": "Y9utakyoKP3BDycRK", "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 and 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": "6AgAp5YaZhmTnsmjB", "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:27:11"} {"_id": "c9w25kSYCGKK7edBu", "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 c.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": "XwiGQMfWQg9CEH7Dp", "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-1-8 19:21:43"} {"_id": "7MQag2GgwYPBTvjdh", "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": "EYne5H3Kh6FcRAW7n", "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:30"} {"_id": "etkMEaDFpiJF2smYp", "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 \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 | one 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": "LYtP8pRovfNGGyJfz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:20:29"} {"_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": "BxnLapAWPXM7jgkzi", "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:49:10"} {"_id": "rp9d4KD7sffMh93g6", "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 c.(Teacher<:Teaches) implies some s.(Teacher<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2szGiiJALjLPg8kro", "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:03:23"} {"_id": "ax8LxNHZfhu89iTxj", "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 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": "86vpkvRTzkcjdGmAN", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:57"} {"_id": "8DDYYnhpXsbKkbZ2N", "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": "GmZkBD4Ci5FqE9y9G", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:30:32"} {"_id": "TYYYuZXiaPfM8wBDg", "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\tsome Class in Teacher\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": "f86Z9ph4Lk59sRvnC", "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 21:13:16"} {"_id": "yd263oaiZcsjfHZfn", "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 one 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": "xCaxoD9Ayx6jWJEvG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:29:50"} {"_id": "TYyBFLn7CYBQdnRee", "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": "xqLyyRw3S3T2sjTdd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:17:05"} {"_id": "WfvLiZxynLrR6HLAk", "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 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": "z9mdESq2bMGBLLpBX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:12"} {"_id": "sjFdFY3KuNjNr7RWu", "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\tClass.Teaches = 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": "xtb3dNEwBciHfoB8x", "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:21:01"} {"_id": "oinwPePP8ExdrcPiL", "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": "Ap69HxDpQfXpEu8jK", "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:34:37"} {"_id": "yXdxkQz8RuKK2gBmW", "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": "RfCManG83AffKLzFQ", "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-15 21:22:37"}